<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对应课程审核详情</title>
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">

    <style>
        body{
            background-color:rgb(243,243,243);
        }
    </style>
</head>
<body>
    <div>
        <table id="demoTable" lay-filter="demoTable"></table>
    </div>
</body>
<input id="courseId" hidden/>
<script>
    layui.use(['jquery','layer','table','form'],function(){
        var $=layui.jquery;
        var layer=layui.layer;
        var table=layui.table;
        var form=layui.form;

        var courseId = localStorage.getItem("courseId");

        getTable();
        function getTable(){
            $.ajax({
                url:"/course/getAuditById",
                data:{"courseId": courseId},
                type:"post",
                dataType:"json",
                success:function (data) {
                    demoTable(data.data);
                }
            })
        }

        function demoTable(data){
            table.render({
                elem:'#demoTable',
                title:"课程详情",
                data:data,
                width:1000,
                cols:[[
                    {field:"implementDate",title:"审核时间",align:'center',width:243},
                    {field:"trueName",title:"审核人员",align:'center',width:244},
                    {field:"result",title:"审核结果",align:'center',width:244,templet:function(data){
                            var result;
                            if(data.result==1){
                                result = "审核通过";
                            }else if(data.result == 2){
                                result = "待审核";
                            }else if(data.result == 3){
                                result = "审核失败";
                            }
                            return '<p>'+result+'</p>';
                    }},
                    {field:"remarks",title:"反馈详情",align:'center',width:260,templet:function(data){
                        if(data.remarks==null){
                            return "无内容";
                        }else{
                            return data.remarks;
                        }
                    }},
                ]],
            })
        }
    })
</script>
</html>